package com.estock.platform.task.support;

import com.estock.common.model.task.Task;

/**
 * invoked by refreshing tasks in cache manager.
 * 
 * @author richard
 *
 */
public class AutoRunTaskThread extends Thread {
	
	private Task task;
	public AutoRunTaskThread(Task task) {
		this.task = task;
	}

	@Override
	public void run() {
		try {
			TaskExecutor.execute(task);
		} catch (Exception e) {
			throw new RuntimeException(
					"Wrong task name for initializing task class");
		}
	}
	
}
